1. Field of the Invention
The present invention relates to a microcomputer comprising a circuit which generates a plurality of desired phase pulses having different cycles within a cycle of a timer circuit which uses a clock as a count source.
2. Description of the Prior Art
Conventionally, the circuit of a microcomputer which generates desired phase pulses within a cycle of a timer circuit which uses a clock as a count source is structured as shown in FIG. 5.
In FIG. 5, reference numeral 1 represents a timer circuit which uses a clock such as a clock outputted by a clock generating circuit, an external clock and a clock divided by a timer (hereinafter referred to as "clock A") as a count source, 7a and 7b registers for retaining desired setting data, 5a and 5b comparators for comparing the data of the registers 7a and 7b with the output of the timer circuit 1, 8 a flip-flop for setting and resetting a port output circuit with the outputs of the comparators 5a and 5b, and 4A a port output circuit for outputting the data to a port.
The operation of the microcomputer will be as follows. In FIG. 5, "5" and "A" are set in the registers 7a and 7b, respectively, as an example. When the timer circuit 1 becomes "5", the value coincides with the setting of the register 7a, and accordingly, the comparator 5a sets the flip-flop 8 so that "HIGH" is outputted to the port output circuit 4A. Next, when the timer circuit 1 becomes "A", the value coincides with the setting of the register 7b, the comparator 5b resets the flip-flop 8 so that LOW is outputted to the port output circuit 4A.
The timing chart of this operation is shown in FIG. 6.
Since the circuit of the conventional microcomputer for generating desired phase pulses is structured as described in the foregoing, a plurality of circuits shown in FIG. 5 are required to generate a plurality of desired phase pulses having different cycles with the result of a large chip area of a microcomputer.